<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/NetBay.Core.BusinessEntities.Workflow" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/NetBay.Core.BusinessEntities.Workflow" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import schemaLocation="http://localhost/RioWCFServices/RioWCFService.svc?xsd=xsd3" namespace="http://schemas.datacontract.org/2004/07/NetBay.Core.BusinessEntities" />
  <xs:import schemaLocation="http://localhost/RioWCFServices/RioWCFService.svc?xsd=xsd5" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
  <xs:complexType name="WorkflowModel">
    <xs:complexContent mixed="false">
      <xs:extension xmlns:q1="http://schemas.datacontract.org/2004/07/NetBay.Core.BusinessEntities" base="q1:ReturnObject">
        <xs:sequence>
          <xs:element minOccurs="0" name="Actions" nillable="true" type="tns:ArrayOfWorkflowAction" />
          <xs:element minOccurs="0" name="AssemblyName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="ClassName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Conditions" nillable="true" type="tns:ArrayOfWorkflowCondition" />
          <xs:element minOccurs="0" name="Description" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Identifier" type="xs:long" />
          <xs:element minOccurs="0" name="IsSystem" type="xs:boolean" />
          <xs:element minOccurs="0" name="Name" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Rules" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="WorkflowType" type="tns:WorkflowType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="WorkflowModel" nillable="true" type="tns:WorkflowModel" />
  <xs:complexType name="ArrayOfWorkflowAction">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="WorkflowAction" nillable="true" type="tns:WorkflowAction" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ArrayOfWorkflowAction" nillable="true" type="tns:ArrayOfWorkflowAction" />
  <xs:complexType name="WorkflowAction">
    <xs:complexContent mixed="false">
      <xs:extension xmlns:q2="http://schemas.datacontract.org/2004/07/NetBay.Core.BusinessEntities" base="q2:ReturnObject">
        <xs:sequence>
          <xs:element minOccurs="0" name="ActionOrConditionId" type="xs:long" />
          <xs:element minOccurs="0" name="AssemblyName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="ClassName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Description" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Identifier" type="xs:long" />
          <xs:element minOccurs="0" name="IsTrigger" type="xs:boolean" />
          <xs:element minOccurs="0" name="Name" nillable="true" type="xs:string" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="WorkflowAction" nillable="true" type="tns:WorkflowAction" />
  <xs:complexType name="WorkflowDefinition">
    <xs:complexContent mixed="false">
      <xs:extension xmlns:q3="http://schemas.datacontract.org/2004/07/NetBay.Core.BusinessEntities" base="q3:ReturnObject">
        <xs:sequence>
          <xs:element minOccurs="0" name="Actions" nillable="true" type="tns:ArrayOfWorkflowAction" />
          <xs:element minOccurs="0" name="AssemblyName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Childs" nillable="true" type="tns:ArrayOfWorkflowDefinition" />
          <xs:element minOccurs="0" name="ClassName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Conditions" nillable="true" type="tns:ArrayOfWorkflowCondition" />
          <xs:element minOccurs="0" name="Description" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="EndDate" nillable="true" type="xs:dateTime" />
          <xs:element minOccurs="0" name="FolderTypeId" type="xs:long" />
          <xs:element minOccurs="0" name="HasChild" type="xs:boolean" />
          <xs:element minOccurs="0" name="Identifier" type="xs:long" />
          <xs:element minOccurs="0" name="IsHierarchical" type="xs:boolean" />
          <xs:element minOccurs="0" name="ModelId" type="xs:long" />
          <xs:element minOccurs="0" name="Name" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="ParentId" nillable="true" type="xs:long" />
          <xs:element xmlns:q4="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="ReceiverGroupId" nillable="true" type="q4:ArrayOflong" />
          <xs:element minOccurs="0" name="ReceiverIndexId" nillable="true" type="xs:long" />
          <xs:element minOccurs="0" name="Receivers" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="ReceiversType" type="tns:ReceiverType" />
          <xs:element minOccurs="0" name="Rules" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="StartDate" type="xs:dateTime" />
          <xs:element minOccurs="0" name="WorkflowType" type="tns:WorkflowType" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="WorkflowDefinition" nillable="true" type="tns:WorkflowDefinition" />
  <xs:complexType name="ArrayOfWorkflowDefinition">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="WorkflowDefinition" nillable="true" type="tns:WorkflowDefinition" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ArrayOfWorkflowDefinition" nillable="true" type="tns:ArrayOfWorkflowDefinition" />
  <xs:complexType name="ArrayOfWorkflowCondition">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="WorkflowCondition" nillable="true" type="tns:WorkflowCondition" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ArrayOfWorkflowCondition" nillable="true" type="tns:ArrayOfWorkflowCondition" />
  <xs:complexType name="WorkflowCondition">
    <xs:complexContent mixed="false">
      <xs:extension xmlns:q5="http://schemas.datacontract.org/2004/07/NetBay.Core.BusinessEntities" base="q5:ReturnObject">
        <xs:sequence>
          <xs:element minOccurs="0" name="ActionOrConditionId" type="xs:long" />
          <xs:element minOccurs="0" name="AssemblyName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="ClassName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Description" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Identifier" type="xs:long" />
          <xs:element minOccurs="0" name="IsTrigger" type="xs:boolean" />
          <xs:element minOccurs="0" name="Name" nillable="true" type="xs:string" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="WorkflowCondition" nillable="true" type="tns:WorkflowCondition" />
  <xs:simpleType name="ReceiverType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="NotAvailable" />
      <xs:enumeration value="Auto" />
      <xs:enumeration value="Index" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="ReceiverType" nillable="true" type="tns:ReceiverType" />
  <xs:complexType name="WorkflowInstance">
    <xs:complexContent mixed="false">
      <xs:extension xmlns:q6="http://schemas.datacontract.org/2004/07/NetBay.Core.BusinessEntities" base="q6:ReturnObject">
        <xs:sequence>
          <xs:element minOccurs="0" name="ChronoId" nillable="true" type="xs:long" />
          <xs:element minOccurs="0" name="CreatedOn" type="xs:dateTime" />
          <xs:element minOccurs="0" name="Definition" nillable="true" type="tns:WorkflowDefinition" />
          <xs:element minOccurs="0" name="DefinitionId" type="xs:long" />
          <xs:element minOccurs="0" name="DefinitionName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="FolderId" type="xs:long" />
          <xs:element minOccurs="0" name="GroupId" type="xs:long" />
          <xs:element minOccurs="0" name="GroupName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="GroupUserId" type="xs:long" />
          <xs:element minOccurs="0" name="HasChild" type="xs:boolean" />
          <xs:element minOccurs="0" name="Identifier" type="xs:long" />
          <xs:element minOccurs="0" name="InstanceUserId" type="xs:long" />
          <xs:element minOccurs="0" name="IsEnded" type="xs:boolean" />
          <xs:element minOccurs="0" name="IsRead" type="xs:boolean" />
          <xs:element minOccurs="0" name="LastActionDate" type="xs:dateTime" />
          <xs:element minOccurs="0" name="LastReadDate" type="xs:dateTime" />
          <xs:element minOccurs="0" name="ParentId" type="xs:long" />
          <xs:element minOccurs="0" name="Receivers" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="RguId" type="xs:long" />
          <xs:element minOccurs="0" name="SendedBy" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Sender" nillable="true" type="q6:User" />
          <xs:element minOccurs="0" name="StartingCondition" type="xs:long" />
          <xs:element minOccurs="0" name="StartingConditionLabel" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="State" type="tns:WorkflowState" />
          <xs:element minOccurs="0" name="StateLabel" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="WorkItems" nillable="true" type="tns:ArrayOfWorkflowItem" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="WorkflowInstance" nillable="true" type="tns:WorkflowInstance" />
  <xs:simpleType name="WorkflowState">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="Running" />
      <xs:enumeration value="Validated" />
      <xs:enumeration value="Rejected" />
      <xs:enumeration value="Transfered" />
      <xs:enumeration value="Indexed" />
      <xs:enumeration value="Finished" />
      <xs:enumeration value="Started" />
      <xs:enumeration value="Faulted" />
      <xs:enumeration value="Replied" />
      <xs:enumeration value="Aborted" />
      <xs:enumeration value="Enveloping" />
      <xs:enumeration value="Read" />
      <xs:enumeration value="ToValidate" />
      <xs:enumeration value="ToIndex" />
      <xs:enumeration value="All" />
      <xs:enumeration value="Ventilated" />
      <xs:enumeration value="Revived" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="WorkflowState" nillable="true" type="tns:WorkflowState" />
  <xs:complexType name="WorkflowInstanceUser">
    <xs:complexContent mixed="false">
      <xs:extension xmlns:q7="http://schemas.datacontract.org/2004/07/NetBay.Core.BusinessEntities" base="q7:ReturnObject">
        <xs:sequence>
          <xs:element minOccurs="0" name="GroupName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Identifier" type="xs:long" />
          <xs:element minOccurs="0" name="InstanceId" type="xs:long" />
          <xs:element minOccurs="0" name="IsDeleted" type="xs:boolean" />
          <xs:element minOccurs="0" name="IsEnded" type="xs:boolean" />
          <xs:element minOccurs="0" name="IsRead" type="xs:boolean" />
          <xs:element minOccurs="0" name="LastActionId" type="xs:long" />
          <xs:element minOccurs="0" name="UserGroupId" type="xs:long" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="WorkflowInstanceUser" nillable="true" type="tns:WorkflowInstanceUser" />
  <xs:complexType name="WorkflowHisto">
    <xs:complexContent mixed="false">
      <xs:extension xmlns:q8="http://schemas.datacontract.org/2004/07/NetBay.Core.BusinessEntities" base="q8:ReturnObject">
        <xs:sequence>
          <xs:element minOccurs="0" name="ActionLabel" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="ActionOrConditionId" type="xs:long" />
          <xs:element minOccurs="0" name="Comment" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="DateAction" type="xs:dateTime" />
          <xs:element minOccurs="0" name="DocumentId" type="xs:long" />
          <xs:element minOccurs="0" name="DocumentName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="HistoGroupName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="HistoUser" nillable="true" type="q8:User" />
          <xs:element minOccurs="0" name="HistoUserFullName" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Identifier" type="xs:long" />
          <xs:element minOccurs="0" name="InstanceIdentifier" type="xs:long" />
          <xs:element minOccurs="0" name="State" type="tns:WorkflowState" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="WorkflowHisto" nillable="true" type="tns:WorkflowHisto" />
  <xs:complexType name="WorkflowItem">
    <xs:complexContent mixed="false">
      <xs:extension xmlns:q9="http://schemas.datacontract.org/2004/07/NetBay.Core.BusinessEntities" base="q9:ReturnObject">
        <xs:sequence>
          <xs:element minOccurs="0" name="Identifier" type="xs:long" />
          <xs:element minOccurs="0" name="ItemType" type="tns:ItemType" />
          <xs:element minOccurs="0" name="Name" nillable="true" type="xs:string" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="WorkflowItem" nillable="true" type="tns:WorkflowItem" />
  <xs:simpleType name="ItemType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Document" />
      <xs:enumeration value="Actions" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="ItemType" nillable="true" type="tns:ItemType" />
  <xs:complexType name="WorkflowDocument">
    <xs:complexContent mixed="false">
      <xs:extension base="tns:WorkflowItem">
        <xs:sequence>
          <xs:element minOccurs="0" name="AchievedBy" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="Comment" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="CreatedOn" type="xs:dateTime" />
          <xs:element minOccurs="0" name="DocumentId" type="xs:long" />
          <xs:element minOccurs="0" name="DocumentStatus" type="tns:WorkflowState" />
          <xs:element minOccurs="0" name="DocumentStatusLabel" nillable="true" type="xs:string" />
          <xs:element minOccurs="0" name="GroupUserId" type="xs:long" />
          <xs:element minOccurs="0" name="InstanceId" type="xs:long" />
          <xs:element minOccurs="0" name="LastActionId" type="xs:long" />
          <xs:element minOccurs="0" name="ModifiedOn" nillable="true" type="xs:dateTime" />
          <xs:element minOccurs="0" name="SenderGroupId" type="xs:long" />
          <xs:element minOccurs="0" name="SenderGroupName" nillable="true" type="xs:string" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="WorkflowDocument" nillable="true" type="tns:WorkflowDocument" />
  <xs:complexType name="WorkflowGenericItem">
    <xs:complexContent mixed="false">
      <xs:extension base="tns:WorkflowItem">
        <xs:sequence />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="WorkflowGenericItem" nillable="true" type="tns:WorkflowGenericItem" />
  <xs:complexType name="ArrayOfWorkflowItem">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="WorkflowItem" nillable="true" type="tns:WorkflowItem" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ArrayOfWorkflowItem" nillable="true" type="tns:ArrayOfWorkflowItem" />
  <xs:simpleType name="WorkflowType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="NotAvailable" />
      <xs:enumeration value="SingleValidating" />
      <xs:enumeration value="Publishing" />
      <xs:enumeration value="Inboxing" />
      <xs:enumeration value="Outboxing" />
      <xs:enumeration value="Invoicing" />
      <xs:enumeration value="Information" />
      <xs:enumeration value="Processing" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="WorkflowType" nillable="true" type="tns:WorkflowType" />
</xs:schema>